import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  Widget _button(context) {
    return RaisedButton(
      onPressed: () =>
          {Navigator.pushNamed(context, '/update', arguments: '1234')},
      child: Text('下载页'),
    );
  }

  Widget _viewLogin(context) {
    return RaisedButton(
      onPressed: () => {Navigator.pushNamed(context, '/login')},
      child: Text('登录页'),
    );
  }

  Widget _viewWebview(context) {
    return RaisedButton(
      onPressed: () => {
        // Navigator.pushNamed(context, '/webview',arguments: 'http://192.168.31.60:8286/')
        Navigator.pushNamed(context, '/webview',arguments: 'http://192.168.31.240:8014/')
        // Navigator.pushNamed(context, '/webview',arguments:'http://yexiaodong.gitee.io/do-vue/#/')
      },
      child: Text('webview'),
    );
  }

  Widget _buildBody(context) {
    return Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          _button(context),
          _viewLogin(context),
          _viewWebview(context)
        ]);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('doFlutter'),
      ),
      body: _buildBody(context),
    );
  }
}
